﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class UserControls_Login : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
      if (HttpContext.Current.User.Identity.IsAuthenticated)
      {
        Response.Redirect("/Konto/TestPage");
      }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
      if (Membership.ValidateUser(txtLoginName.Text, txtPass.Text))
      {
        FormsAuthentication.SetAuthCookie(txtLoginName.Text, true);
        Response.Redirect("/Aktieanalyser");
      }
      else
      {
        Response.Redirect("/");
      }
    }
}